-- GENERATED SPELL FOR [Twilight Prophet] --


function spell0_15308(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(15305,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15308', 3000, 1)
end

function spell1_15308(pUnit, Event) --@Fire Nova,Self--
pUnit:FullCastSpellOnTarget(17366,pUnit)
pUnit:RegisterEvent('Sorts_15308', 530, 1)
end

function spell2_15308(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(15531,pUnit)
pUnit:RegisterEvent('Sorts_15308', 8313, 1)
end

function spell3_15308(pUnit, Event) --@Psychic Scream,Self--
pUnit:FullCastSpellOnTarget(22884,pUnit)
pUnit:RegisterEvent('Sorts_15308', 4327, 1)
end

function Sorts_15308(pUnit, Event)
local choix_sorts_15308 = math.random(0, 3)
if choix_sorts_15308 == 0 then
pUnit:RegisterEvent('spell0_15308', 1, 1)
end
if choix_sorts_15308 == 1 then
pUnit:RegisterEvent('spell1_15308', 1, 1)
end
if choix_sorts_15308 == 2 then
pUnit:RegisterEvent('spell2_15308', 1, 1)
end
if choix_sorts_15308 == 3 then
pUnit:RegisterEvent('spell3_15308', 1, 1)
end
end

function mob15308_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15308', math.random(1500, 3000), 1)
end

function mob15308_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15308_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15308_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15308, 1, 'mob15308_Action')
RegisterUnitEvent(15308, 2, 'mob15308_Leave')
RegisterUnitEvent(15308, 3, 'mob15308_Kill')
RegisterUnitEvent(15308, 4, 'mob15308_Die')
